package com.viknix.springboot.demo.service.impl;

import com.viknix.springboot.demo.config.Config;
import com.viknix.springboot.demo.service.ConditionalService;
import lombok.AllArgsConstructor;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author: Dongqi
 * @Date: 2021/11/20 13:19
 * @Version 1.0
 * @Description:
 */
@Service
@AllArgsConstructor
public class ConditionalServiceImpl implements ConditionalService {

    private ApplicationContext context;

    @Override
    public Map<String, Config> testConditional() {
        Map<String, Config> beansOfType = context.getBeansOfType(Config.class);
        return beansOfType;
    }
}
